package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SeedAmountMapper;
import com.ruoyi.system.domain.SeedAmount;
import com.ruoyi.system.service.ISeedAmountService;

/**
 * 种子量Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-07
 */
@Service
public class SeedAmountServiceImpl implements ISeedAmountService 
{
    @Autowired
    private SeedAmountMapper seedAmountMapper;

    /**
     * 查询种子量
     * 
     * @param seedAmountId 种子量ID
     * @return 种子量
     */
    @Override
    public SeedAmount selectSeedAmountById(Long seedAmountId)
    {
        return seedAmountMapper.selectSeedAmountById(seedAmountId);
    }

    /**
     * 查询种子量列表
     * 
     * @param seedAmount 种子量
     * @return 种子量
     */
    @Override
    public List<SeedAmount> selectSeedAmountList(SeedAmount seedAmount)
    {
        return seedAmountMapper.selectSeedAmountList(seedAmount);
    }

    /**
     * 新增种子量
     * 
     * @param seedAmount 种子量
     * @return 结果
     */
    @Override
    public int insertSeedAmount(SeedAmount seedAmount)
    {
        seedAmount.setCreateTime(DateUtils.getNowDate());
        return seedAmountMapper.insertSeedAmount(seedAmount);
    }

    /**
     * 修改种子量
     * 
     * @param seedAmount 种子量
     * @return 结果
     */
    @Override
    public int updateSeedAmount(SeedAmount seedAmount)
    {
        seedAmount.setUpdateTime(DateUtils.getNowDate());
        return seedAmountMapper.updateSeedAmount(seedAmount);
    }

    /**
     * 批量删除种子量
     * 
     * @param seedAmountIds 需要删除的种子量ID
     * @return 结果
     */
    @Override
    public int deleteSeedAmountByIds(Long[] seedAmountIds)
    {
        return seedAmountMapper.deleteSeedAmountByIds(seedAmountIds);
    }

    /**
     * 删除种子量信息
     * 
     * @param seedAmountId 种子量ID
     * @return 结果
     */
    @Override
    public int deleteSeedAmountById(Long seedAmountId)
    {
        return seedAmountMapper.deleteSeedAmountById(seedAmountId);
    }
}
